<template>
     <div class="totaltime">
        <div class="title-box">
            <h3><router-link to="/home">«</router-link>番茄统计</h3>
        </div>
        <div class="content-box">
            <h3><span></span>统计</h3>
            <div class="con">
                <div class="c-left">
                    <h4>{{totalTime}}</h4>
                    <p>专注时间(分)</p>
                </div>
                <div class="c-right">
                    <h4>{{totalNum}}</h4>
                    <p>专注次数(次)</p>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name:"totalTime",
    data(){
        return {
            totalTime:0,
            totalNum:0
        }
    },
    methods:{
        getTime(){
            this.totalTime = localStorage.getItem("totalTime"),
            this.totalTime = (this.totalTime / 60).toFixed(1);
            this.totalNum = localStorage.getItem("totalNum")
        }
    },
    mounted(){
        this.getTime();
    }
}
</script>

<style lang="less" scoped>
.totaltime {
    width: 100%;
    .title-box {
        width: 100%;
        height: 80px;
        h3 {
            padding-left: 60px;
            box-sizing: border-box;
            position: relative;
            font-size: 22px;
            line-height: 42px;
            font-weight: bold;
            a {
                position: absolute;
                left: 20px;
                top: 0;
                font-size: 30px;
                background-color: transparent;
            }
        }
    }
    .content-box {
        h3 {
            width: 100%;
            font-size: 18px;
            box-sizing: border-box;
            padding-left: 60px;
            position: relative;
            span {
                display: block;
                width: 22px;
                height: 22px;
                background-image: url(../assets/images/totaltime.png);
                background-size: 22px;
                background-repeat: no-repeat;
                background-position: center;
                position: absolute;
                left: 30px;
                top: 0;
            }
        }
        .con {
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding-top: 30px;
            h4 {
                font-size: 20px;
                font-weight: bold;
                margin-bottom: 10px;
            }
            p {
                font-size: 14px;
                color: #606060;
            }
            div {
                flex-grow: 1;
                text-align: center;
            }
        }
    }
}
</style>